<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1. 代替Object的某些方法
        let obj = {}
        Reflect.defineProperty(obj, "name", {
            value: "twj",
            writable: false, //设置属性值不可改
            enumerable: false //设置name属性不可删
        })
        console.log(obj)
    </script>
</body>

</html>